<%@page import="org.springframework.web.context.request.SessionScope"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@	page import="kau.dao.*"%>
<%@	page import="kau.vo.*"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">

<title>비밀번호변경</title>
<script type="text/javascript">
	function MainSubmit() {

		var password0 = document.fm.password0.value;
		var password_old = document.fm.password_old.value;
		var password1 = document.fm.password1.value;
		var password2 = document.fm.password2.value;

		if (password0 == '') {
			alert('현재 사용중인 비밀번호를 입력하세요.');
			return false;
		}
		if (password1 == '' || password2 == '') {
			alert('새로운  비밀번호를 입력하세요.');
			return false;
		} else if (password1 != password2) {
			alert('새로운 비밀번호를 다시 입력해 주세요.');
			return false;
		} else if (password1.length < 6 || password2.length < 6) {
			alert('새로운 비밀번호는 6자 이상으로 입력해 주세요.');
			return false;
		} else if (password0 != password_old) {
			alert('현재 사용중인 비밀번호를 다시 입력해 주세요.');
			return false;
		} else {
			alert('비밀번호가 변경됐습니다.');
			return true;
		}
	}
</script>
<style type="text/css">
#info {
	font-family: 맑은 고딕, dotum, sans-serif, bold;
	font-size: 13px
}
</style>

<style type="text/css">
<!--
@import url("/nems/css/style.css");
-->
</style>
</head>

<body>

	<%
		String custId = (String) session.getAttribute("custId");
		String password = CustomerDAOImpl.getInstance().getCustomer(custId)
				.getPassword();
	%>





	<div style="margin-left: 20px; margin-bottom: 30px" id="info">
		<div class="content_header">
			<br>
			<table align="left">

				<tr>
					<td><img src="/nems/cust/img/changePassImg.png" width="40" /></td>
					<td>
						<h4
							style="font-weight: bold; color: #005700; text-align: left; font-size: 20px;">비밀번호
							변경</h4>
					</td>

				</tr>
			</table>

			<center>
				<br> <br> <br>
				<p>회원님의 비밀번호를 수정할 수 있습니다.</p>
				<br>

				<p>
					<strong>현재 비밀번호와 새 비밀번호를 입력해주세요.</strong>
				</p>
			</center>
		</div>

		<div class="section">
			<form name="fm" method="post" action="update_pass.cust">
				<input type="hidden" name="custId" value="<%=custId%>" /> <input
					type="hidden" name="password0" value="<%=password%>">
				<div class="pw">

					<table width="600" border="0">
						<tr>
							<td colspan="2">
								<hr width="670">
							</td>
						</tr>
						<tr align="center">
							<td width="300" height="40">현재 비밀번호</td>
							<td width="300"><input type="password" name="password_old" /></td>
						</tr>
						<tr align="center">
							<td width="300" height="40">새 비밀번호</td>
							<td><input type="password" name="password1" /></td>
						</tr>
						<tr align="center">
							<td width="300" height="40">새 비밀번호 확인</td>
							<td><input type="password" name="password2" /></td>
						</tr>
						<tr>
							<td colspan="2">
								<hr width="670">
							</td>
						</tr>


						<tr align="center">
							<td colspan="2"><br> <br> <img
								src="/nems/cust/img/chagePassSubmsg.png"><br> <br>
							</td>
						</tr>

						<tr align="center">
							<td colspan="2">
								<button type="submit" class="positive" style="width: 70px"
									onclick="return MainSubmit()">
									<img src="cust/img/shopping_cart_accept.png"
										style="width: 20px; height: 10px" />확인
								</button>

							</td>
						</tr>
					</table>


			</form>
		</div>
	</div>

</body>
</html>